package com.tul.exercise.base.clazz.base.eg1;

/**
 * @author tul
 * 《java编程思想》 14章 示例1
 *  基类
 */
public abstract class Shape {

    protected String name;

    public Shape() {
        name = "Shape";
    }

    /**
     *
     */
    void draw() {
        print(this + ".draw()");
    }

    abstract  public String toString();

    /**
     * 打印方法
     * @param obj 对象
     */
    protected  static void print(Object obj) {
        System.out.println(obj);
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }
}
